﻿using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using mfRCF.netmf;
using mfRCF.Core;

namespace mfRCF.NetduinoPlus2.TestApp
{
    public class Program
    {
        public static void Main()
        {
            //initialize network (out-of-the-rcf-box)
            mfNetworkInitialization.InitializeNetworkInfrastructure();

            //register specified rcf-commands
            mfRcf.Instance.Commands.Add(new RssGetCommand("/rss"));
            mfRcf.Instance.Commands.Add(new StateGetCommand("/state"));
            mfRcf.Instance.Commands.Add(new DateGetCommand("/date"));
            mfRcf.Instance.Commands.Add(new DatePostCommand("/date"));
            mfRcf.Instance.Commands.Add(new OnboardLedGetCommand("/led"));

            //initialize & start rcf
            var rcfPlattformProvider = new mfRcfPlattformProvider();
            mfRcf.Instance.PlattformProvider = rcfPlattformProvider;
            mfRcf.Instance.Start();
        }
    }
}
